home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / organiza / stabiliz.sit / The Stabilizer / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1989-02-05  |  20.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>34</cardCount>
  7.     <cardID>9877</cardID>
  8.     <listID>18180</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>--Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  17. --Thank you to: Andrew Gilmartin (Brown University) for XFCN PopUpMenu
  18.  
  19. on openStack
  20. global saveMsg
  21. hide msg
  22. hide menuBar
  23. put loc of msg into saveMsg
  24. push card "Expenses"
  25. get card field "allExpenses" of card "whichMonths"
  26. if it = empty then exit openStack
  27. get the date
  28. convert it to seconds
  29. if it >= line 2 of card field "startMonth" of┬¼
  30. card "Year Totals" then
  31. answer "It's time to recalculate, do it now?" with "No" or "Yes"
  32. if it is "Yes" then
  33. put last word of the long date into whichYear
  34. if word 1 of item 2 of the long date Γëá "January" then put " -" &&┬¼
  35. whichYear + 1 after whichYear
  36. set loc of msg to 19,106
  37. put "Estimating expenses for" && whichYear & ", please wait."
  38. get line 2 of card field "startMonth" of card "Year Totals"
  39. convert it to long date
  40. add 1 to last item of it
  41. convert it to seconds
  42. put it into line 2 of card field "startMonth" of┬¼
  43. card "Year Totals"
  44. doEstimate
  45. doMath
  46. hide msg
  47. end if
  48. end if
  49. end openStack
  50.  
  51. on idle
  52. global moreExpenses
  53. if moreExpenses = 1 then addExpense
  54. set cursor to 5
  55. pass idle
  56. end idle
  57.  
  58. on helpIndex
  59. visual venetian blinds to gray
  60. visual venetian blinds
  61. go card "HelpIndex"
  62. end helpIndex
  63.  
  64. on addExpense
  65. global expenseAmount,expense,moreExpenses
  66. push card
  67. Get card field "allExpenses" of card "whichMonths"
  68. if the number of lines of it >= 48 then
  69. answer "You can not enter more than 48 items" with "OK"
  70. get field expense3 of card "Expenses"
  71. if line 16 of it = empty then noMore
  72. put empty into moreExpenses
  73. exit addExpense
  74. end if
  75. set numberFormat to "0.00"
  76. repeat forever
  77. ask "Please enter an expense item"
  78. repeat
  79. if "," is in it then
  80. put offset (",",it) into er
  81. delete char er of it
  82. else
  83. exit repeat
  84. end if
  85. end repeat
  86. put it into expenseItem
  87. if expenseItem = empty then exit repeat
  88. if the length of expenseItem > 18 then
  89. answer "Expense items can have only 18 characters" with "OK"
  90. exit addExpense
  91. end if
  92. put expenseItem&"," into expense
  93. answer "Do you pay the same amount every time?" with "No" or "Yes"
  94. if it is "yes" then
  95. repeat forever
  96. ask "Please enter the amount for"&&expenseItem
  97. if it is empty then
  98. answer "Do you want to delete this expense?" with┬¼
  99. "Yes" or "No"
  100. if it is "yes" then
  101. put empty into expense
  102. exit repeat
  103. else
  104. next repeat
  105. end if
  106. else
  107. exit repeat
  108. end if
  109. end repeat
  110. if expense = empty then next repeat
  111. put "$" into expenseAmount
  112. if char 1 of it = "$" then delete char 1 of it
  113. repeat
  114. if "," is in it then
  115. put offset (",",it) into er
  116. delete char er of it
  117. else
  118. exit repeat
  119. end if
  120. end repeat
  121. add 0 to it
  122. put it & "," after expenseAmount
  123. put expenseAmount after expense
  124. answer "Do you pay this expense every month?" with "No" or "Yes"
  125. else
  126. put "variable," into expenseAmount
  127. put expenseAmount after expense
  128. end if
  129. if it is "yes" and expenseAmount Γëá "variable," then
  130. put "Every┬áMonth" after expense
  131. exit repeat
  132. else
  133. visual venetian blinds to gray
  134. visual venetian blinds
  135. go card "whichMonths"
  136. put empty into moreExpenses
  137. exit addExpense
  138. end if
  139. end repeat
  140. doAlphabet
  141. answer "Are you finished adding expenses?" with "Yes" or "No"
  142. if it = "yes" then
  143. put the number of lines of card field "allExpenses"┬¼
  144. of card "whichMonths" into test1
  145. put the number of lines of field "expense" of card "Expenses"┬¼
  146. into test2
  147. add the number of lines of field "expense2" of card "Expenses"┬¼
  148. to test2
  149. add the number of lines of field "expense3" of card "Expenses"┬¼
  150. to test2
  151. if test2 < test1 then
  152. noMore
  153. else
  154. put empty into moreExpenses
  155. end if
  156. end if
  157. end addExpense
  158.  
  159. on doAlphabet
  160. global expense
  161. set cursor to 4
  162. set loc of msg to 19,106
  163. put "Please wait"
  164. if expense = empty then
  165. hide msg
  166. exit doAlphabet
  167. end if
  168. repeat with x = 1 to the length of item 1 of expense
  169. put the charToNum of char x of item 1 of expense into temp
  170. if temp >= 97 and temp <= 122 then
  171. put temp - 32 into temp
  172. put the numToChar of temp into char x of item 1 of expense
  173. end if
  174. end repeat
  175. put card field "allExpenses" of card "whichMonths" into allExpenses
  176. if allExpenses = empty then
  177. put expense into card field "allExpenses" of card "whichMonths"
  178. put empty into expense
  179. hide msg
  180. exit doAlphabet
  181. end if
  182. put item 1 of expense into ex
  183. put 1 into y
  184. put 1 into z
  185. repeat
  186. if ex = item 1 of line y of allExpenses then
  187. answer "You can't enter the same expense item twice." with "OK"
  188. ask "Please enter a different name for" && ex
  189. if it = ex or it = empty then
  190. put empty into expense
  191. hide msg
  192. exit doAlphabet
  193. else
  194. repeat
  195. if "," is in it then
  196. put offset (",",it) into er
  197. delete char er of it
  198. else
  199. exit repeat
  200. end if
  201. end repeat
  202. put it into ex
  203. repeat
  204. if the length of ex > 18 then
  205. delete last char of ex
  206. else
  207. exit repeat
  208. end if
  209. end repeat
  210. repeat with x = 1 to the length of ex
  211. put the charToNum of char x of ex into temp
  212. if temp >= 97 and temp <= 122 then
  213. put temp - 32 into temp
  214. put the numToChar of temp into char x of ex
  215. end if
  216. end repeat
  217. put ex into item 1 of expense
  218. put 1 into y
  219. put 1 into z
  220. end if
  221. end if
  222. if line y of allExpenses = empty then
  223. put return & expense after last line of card field "allExpenses"┬¼
  224. of card "whichMonths"
  225. put empty into expense
  226. hide msg
  227. exit doAlphabet
  228. end if
  229. if the charToNum of char z of ex = the charToNum of char z┬¼
  230. of item 1 of line y of allExpenses then
  231. add 1 to z
  232. if char z of item 1 of line y of allExpenses = empty then
  233. add 1 to y
  234. put 1 into z
  235. next repeat
  236. end if
  237. if char z of ex = empty then
  238. put expense & return before line y of card field "allExpenses"┬¼
  239. of card "whichMonths"
  240. put empty into expense
  241. hide msg
  242. exit doAlphabet
  243. end if
  244. next repeat
  245. end if
  246. if the charToNum of char z of ex < the charToNum of char z┬¼
  247. of item 1 of line y of allExpenses then
  248. put expense & return before line y of card field "allExpenses"┬¼
  249. of card "whichMonths"
  250. put empty into expense
  251. hide msg
  252. exit doAlphabet
  253. else
  254. add 1 to y
  255. put "1" into z
  256. next repeat
  257. end if
  258. end repeat
  259. hide msg
  260. end doAlphabet
  261.  
  262. on noMore
  263. global moreExpenses
  264. set loc of msg to 19,106
  265. put "This will take a couple of minutes, please wait."
  266. put empty into moreExpenses
  267. set cursor to 4
  268. set lockScreen to true
  269. put card field "allExpenses" of card "whichMonths" into allExpenses
  270. repeat with x = 2 to 13
  271. put empty into field expense of card x
  272. put empty into field amount of card x
  273. put empty into field expense2 of card x
  274. put empty into field amount2 of card x
  275. end repeat
  276. put empty into field expense of card "Expenses"
  277. put empty into field expense2 of card "Expenses"
  278. put empty into field expense3 of card "Expenses"
  279. repeat with i = 1 to the number of lines in allExpenses
  280. put item 1 of line i of allExpenses into expenseName
  281. put expenseName & return after field expense of card "Expenses"
  282. if item 3 of line i of allExpenses = "Every Month" then
  283. repeat with x = 2 to 13
  284. put expenseName & return after field expense of card x
  285. put item 2 of line i of allExpenses & return after field amount┬¼
  286. of card x
  287. end repeat
  288. else
  289. if item 2 of line i of allExpenses = "Variable" then
  290. repeat with x = 3 to the number of items in┬¼
  291. line i of allExpenses
  292. put word 1 of item x of line i of allExpenses into which
  293. put expenseName & return after field expense of card which
  294. put last word of item x of line i of allExpenses & return┬¼
  295. after field amount of card which
  296. end repeat
  297. else
  298. repeat with x = 3 to the number of items in┬¼
  299. line i of allExpenses
  300. put item x of line i of allExpenses into which
  301. put expenseName & return after field expense of card which
  302. put item 2 of line i of allExpenses & return after field┬¼
  303. amount of card which
  304. end repeat
  305. end if
  306. end if
  307. end repeat
  308. repeat with x = 2 to 13
  309. put line 16 to 30 of field expense of card x into field expense2┬¼
  310. of card x
  311. delete line 16 to 30 of field expense of card x
  312. put line 16 to 30 of field amount of card x into field amount2┬¼
  313. of card x
  314. delete line 16 to 30 of field amount of card x
  315. end repeat
  316. put line 17 to 32 of field expense of card "Expenses" into field expense2┬¼
  317. of card "Expenses"
  318. put line 33 to 48 of field expense of card "Expenses" into field expense3┬¼
  319. of card "Expenses"
  320. delete line 17 to 48 of field expense of card "Expenses"
  321. hide msg
  322. end noMore
  323.  
  324. on seeItems
  325. put card field "allExpenses" of card "whichMonths" into allExpenses
  326. put (item 2 of the clickLoc - 39) div 16 into whichLine
  327. put the short name of the target into whichField
  328. if line whichLine of field whichField is empty then exit seeItems
  329. get line whichLine of field whichField
  330. repeat with i = 1 to the number of lines in allExpenses
  331. if it = item 1 of line i of allExpenses then
  332. put line i of allExpenses into theList
  333. exit repeat
  334. end if
  335. end repeat
  336. if item 3 of theList = "Every Month" then put "," & card┬¼
  337. field "monthList" of card "Expenses" after theList
  338. put the mouseloc into listHere
  339. put item 1 of listHere + 1 into horiz
  340. put item 2 of listHere - 10 into vert
  341. get the number of items in theList
  342. put vert + (it * 17) into length
  343. if length > 314 then subtract (length - 324) from vert
  344. get PopUpMenu(theList, 1, vert, horiz)
  345. put item it of theList into whatCard
  346. if it = 1 then
  347. visual barn door close slowly to gray
  348. visual barn door open slowly
  349. go card whatCard
  350. if the result Γëá empty then
  351. repeat
  352. answer "Automatic cost adjustment for this expense?" with "Help"┬¼
  353. or "Yes" or "No"
  354. if it = "Help" then
  355. push card
  356. visual venetian blinds
  357. go card it
  358. show card field "Cost"
  359. repeat until the mouse is down
  360. end repeat
  361. visual venetian blinds
  362. pop card
  363. else
  364. exit repeat
  365. end if
  366. end repeat
  367. if it = "Yes" then
  368. go card "template"
  369. doMenu "New Card"
  370. put item 1 of theList into bill
  371. set name of this card to bill
  372. put "," & bill after line 3 of card field "startMonth" of card┬¼
  373. "Year Totals"
  374. repeat with y = 1 to the number of fields
  375. put field y of card "template" into field y of card bill
  376. end repeat
  377. put bill into field "title" of card bill
  378. put field "months" of card bill into tempMon
  379. set numberFormat to "0.00"
  380. if item 3 of theList = "Every Month" then
  381. set numberFormat to "0"
  382. ask "Enter amount for"&& bill && "in" && last item┬¼
  383. of the long date - 1 with item 2 of theList
  384. set numberFormat to "0.00"
  385. repeat
  386. if "," is in it then
  387. put offset (",",it) into er
  388. delete char er of it
  389. else
  390. exit repeat
  391. end if
  392. end repeat
  393. if it = empty then put item 2 of the list into it
  394. if char 1 of it = "$" then delete char 1 of it
  395. add 0 to it
  396. put "$" before it
  397. repeat with y = 1 to 12
  398. put item 2 of theList into line y of act
  399. put it into line y of amo
  400. end repeat
  401. else
  402. if item 2 of theList = "variable" then
  403. put theList into oldList
  404. repeat with i = 3 to the number of items in theList
  405. ask "Enter amount for 1 yr before last" && word 1 of┬¼
  406. item i of theList with last word of item i of theList
  407. repeat
  408. if "," is in it then
  409. put offset (",",it) into er
  410. delete char er of it
  411. else
  412. exit repeat
  413. end if
  414. end repeat
  415. if it = empty then put last word of item i of┬¼
  416. theList into it
  417. if char 1 of it = "$" then delete char 1 of it
  418. add 0 to it
  419. put "$" before it
  420. repeat with x = 1 to 12
  421. if word 1 of item i of theList = line x of┬¼
  422. tempMon then exit repeat
  423. end repeat
  424. put last word of item i of theList into line x of act
  425. put it into line x of amo
  426. end repeat
  427. else
  428. put theList into oldList
  429. set numberFormat to "0"
  430. ask "Enter amount for"&& bill && "in" && last item┬¼
  431. of the long date - 1 with item 2 of theList
  432. repeat
  433. if "," is in it then
  434. put offset (",",it) into er
  435. delete char er of it
  436. else
  437. exit repeat
  438. end if
  439. end repeat
  440. set numberFormat to "0.00"
  441. if it = empty then put item 2 of the list into it
  442. if char 1 of it = "$" then delete char 1 of it
  443. add 0 to it
  444. put "$" before it
  445. repeat with i = 3 to the number of items in theList
  446. repeat with x = 1 to 12
  447. if word 1 of item i of theList = line x of┬¼
  448. tempMon then exit repeat
  449. end repeat
  450. put item 2 of theList into line x of act
  451. put it into line x of amo
  452. end repeat
  453. end if
  454. set cursor to 4
  455. end if
  456. put act into field "actual" of card bill
  457. put amo into field "amount" of card bill
  458. put "0" into totalAct
  459. put "0" into totalAmo
  460. repeat with y = 1 to 12
  461. delete char 1 of line y of act
  462. delete char 1 of line y of amo
  463. add line y of act to totalAct
  464. add line y of amo to totalAmo
  465. end repeat
  466. set numberFormat to "0.0"
  467. put ((totalAct - totalAmo)/totalAmo)*100 into inc
  468. if inc < 0 then put 0 into inc
  469. put inc & "%" into line 2 of field "increase" of card bill
  470. set numberFormat to "0.00"
  471. repeat with y = 1 to 12
  472. if line y of act Γëá empty then
  473. put "$" & line y of amo + (line y of amo * inc/100) into┬¼
  474. line y of pro
  475. put "$" & line y of amo - (line y of amo * inc/100) into┬¼
  476. line y of bas
  477. end if
  478. end repeat
  479. put pro into field "projected" of card bill
  480. put bas into field "base" of card bill
  481. if item 2 of theList = "Variable" then
  482. get word 1 of item 2 of the long date
  483. repeat with i = 1 to 12
  484. if it = line i of tempMon then exit repeat
  485. end repeat
  486. put i into t
  487. repeat with i = i to 12
  488. put line i of field "actual" of card bill into line i of┬¼
  489. field "amount" of card bill
  490. put line i of field "amount" of card bill into line i of┬¼
  491. field "base" of card bill
  492. if line i of act Γëá empty then
  493. put "$" & line i of act + (line i of act * inc/100) into┬¼
  494. line i of field "projected" of card bill
  495. put "$" & line i of act - (line i of act * inc/100) into┬¼
  496. line i of field "base" of card bill
  497. end if
  498. put empty into line i of field "actual" of card bill
  499. end repeat
  500. repeat
  501. answer "Estimate" && bill && "and recalculate?" with "Help"┬¼
  502. or "Yes" or "No"
  503. if it = "Help" then
  504. push card
  505. visual venetian blinds
  506. go card it
  507. show card field "Estimate"
  508. repeat until the mouse is down
  509. end repeat
  510. visual venetian blinds
  511. pop card
  512. else
  513. exit repeat
  514. end if
  515. end repeat
  516. if it is "Yes" then
  517. set loc of msg to 19,106
  518. put "Estimating expense, please wait."
  519. repeat with t = t to 12
  520. get line t of field "amount" of card bill
  521. if it Γëá empty then
  522. put line t of field "projected" of card bill into proAm
  523. put proAm into line t of field "actual" of card bill
  524. put line t of tempMon into┬¼
  525. whichMonth
  526. repeat with s = 1 to the number of items in theList
  527. if whichMonth is in item s of theList then exit repeat
  528. end repeat
  529. put proAm into last word of item s of theList
  530. repeat with y = 1 to 3
  531. if bill is in field y of card whichMonth then
  532. repeat with i = 1 to the number of lines in field y┬¼
  533. of card whichMonth
  534. if bill = line i of field y of card┬¼
  535. whichMonth then
  536. put proAm into line i of field (y + 1) of┬¼
  537. card whichMonth
  538. exit repeat
  539. end if
  540. end repeat
  541. exit repeat
  542. end if
  543. end repeat
  544. repeat with i = 1 to the number of lines in allExpenses
  545. if bill = item 1 of line i of allExpenses then
  546. put theList into line i of card field "allExpenses"┬¼
  547. of card "whichMonths"
  548. exit repeat
  549. end if
  550. end repeat
  551. end if
  552. end repeat
  553. doMath
  554. end if
  555. end if
  556. end if
  557. end if
  558. else
  559. if whatCard = "Every Month" then
  560. answer "You can't go to every month at once." with "OK"
  561. exit seeItems
  562. else
  563. put word 1 of whatCard into whatCard
  564. end if
  565. visual barn door close slowly to gray
  566. visual barn door open slowly
  567. go card whatCard
  568. end if
  569. end seeItems
  570.  
  571. on doEstimate
  572. set cursor to 4
  573. put last word of the long date into whichYear
  574. if word 1 of item 2 of the long date Γëá "January" then put " -" &&┬¼
  575. whichYear + 1 after whichYear
  576. put whichYear into field "thisYear1" of card "template"
  577. put whichYear into field "thisYear2" of card "template"
  578. put "SUMMARY FOR" && whichYear into card field "title"┬¼
  579. of card "Year Totals"
  580. if whichYear = last word of the long date then
  581. put whichYear - 1 into field "lastYear" of card "template"
  582. else
  583. subtract 1 from first word of whichYear
  584. subtract 1 from last word of whichYear
  585. put whichYear into field "lastYear" of card "template"
  586. end if
  587. put card field "allExpenses" of card "whichMonths" into allExpenses
  588. put line 3 of card field "startMonth" of card "Year Totals" into┬¼
  589. whichBill
  590. put field "months" of card "template" into tempMon
  591. repeat with i = 2 to the number of items in whichBill
  592. put item i of whichBill into bill
  593. repeat with x = 1 to the number of lines in allExpenses
  594. if bill = item 1 of line x of allExpenses then
  595. put line x of allExpenses into theList
  596. exit repeat
  597. end if
  598. end repeat
  599. put field "thisYear1" of card "template" into field "thisYear1"┬¼
  600. of card bill
  601. put field "thisYear2" of card "template" into field "thisYear2"┬¼
  602. of card bill
  603. put field "lastYear" of card "template" into field "lastYear"┬¼
  604. of card bill
  605. put field "amount" of card bill into amo
  606. put field "actual" of card bill into act
  607. put field "projected" of card bill into pro
  608. repeat with y = 1 to 12
  609. if line y of amo Γëá empty and line y of act = empty then put┬¼
  610. line y of pro into line y of act
  611. end repeat
  612. if item 2 of theList Γëá "Variable" then
  613. repeat with y = 1 to 12
  614. if line y of act Γëá empty then
  615. put line y of act into test
  616. exit repeat
  617. end if
  618. end repeat
  619. repeat with y = 1 to 12
  620. if line y of act Γëá empty and line y of act Γëá┬¼
  621. test then exit repeat
  622. end repeat
  623. repeat with z = y to 12
  624. if line z of amo Γëá empty then put test into line z of amo
  625. end repeat
  626. put amo into field "base" of card bill
  627. put act into field "amount" of card bill
  628. repeat with z = 1 to y - 1
  629. if line z of act Γëá empty then
  630. put line y of act into line z of act
  631. put line y of act into line z of field "projected"┬¼
  632. of card bill
  633. end if
  634. end repeat
  635. put line y of act into test2
  636. delete char 1 of test
  637. delete char 1 of test2
  638. set numberFormat to "0.0"
  639. put ((test2 - test)/test)*100 into inc
  640. if inc < 0 then put 0 into inc
  641. put inc & "%" into line 2 of field "increase" of card bill
  642. set numberFormat to "0.00"
  643. repeat with z = y to 12
  644. if line z of amo Γëá empty then
  645. delete char 1 of line z of act
  646. put "$" & line z of act + (line z of act * inc/100) into┬¼
  647. line z of field "projected" of card bill
  648. put "$" & line z of act + (line z of act * inc/100) into┬¼
  649. item 2 of theList
  650. end if
  651. put empty into line z of act
  652. end repeat
  653. put act into field "actual" of card bill
  654. else
  655. put amo into field "base" of card bill
  656. put act into field "amount" of card bill
  657. put empty into field "actual" of card bill
  658. put "0" into totalAct
  659. put "0" into totalAmo
  660. repeat with y = 1 to 12
  661. delete char 1 of line y of act
  662. delete char 1 of line y of amo
  663. add line y of act to totalAct
  664. add line y of amo to totalAmo
  665. end repeat
  666. set numberFormat to "0.0"
  667. put ((totalAct - totalAmo)/totalAmo)*100 into inc
  668. if inc < 0 then put 0 into inc
  669. put inc & "%" into line 2 of field "increase" of card bill
  670. set numberFormat to "0.00"
  671. repeat with y = 1 to 12
  672. if line y of amo Γëá empty then put "$" & line y of┬¼
  673. act + (line y of act * inc/100) into line y of┬¼
  674. field "projected" of card bill
  675. end repeat
  676. end if
  677. repeat with t = 1 to 12
  678. get line t of field "projected" of card bill
  679. if it Γëá empty then
  680. put it into proAm
  681. put line t of tempMon into whichMonth
  682. if item 2 of theList = "variable" then
  683. repeat with s = 1 to the number of items in theList
  684. if whichMonth is in item s of theList then exit repeat
  685. end repeat
  686. put proAm into last word of item s of theList
  687. end if
  688. repeat with y = 1 to 3
  689. if bill is in field y of card whichMonth then
  690. repeat with i = 1 to the number of lines in field y┬¼
  691. of card whichMonth
  692. if bill = line i of field y of card┬¼
  693. whichMonth then
  694. put proAm into line i of field (y + 1) of┬¼
  695. card whichMonth
  696. exit repeat
  697. end if
  698. end repeat
  699. exit repeat
  700. end if
  701. end repeat
  702. repeat with i = 1 to the number of lines in allExpenses
  703. if bill = item 1 of line i of allExpenses then
  704. put theList into line i of card field "allExpenses"┬¼
  705. of card "whichMonths"
  706. exit repeat
  707. end if
  708. end repeat
  709. end if
  710. end repeat
  711. end repeat
  712. end doEstimate
  713.  
  714. on doMath
  715. set cursor to 4
  716. set loc of msg to 19,106
  717. put "Calculating, please wait."
  718. set numberFormat to "0.00"
  719. put "0" into temp4
  720. repeat with x = 2 to 13
  721. put "0" into temp2
  722. repeat with i = 1 to the number of lines in field 2 of card x
  723. put line i of field 2 of card x into temp1
  724. delete char 1 of temp1
  725. add temp1 to temp2
  726. end repeat
  727. repeat with i = 1 to the number of lines in field 4 of card x
  728. put line i of field 4 of card x into temp1
  729. delete char 1 of temp1
  730. add temp1 to temp2
  731. end repeat
  732. put "$" & temp2 into field "subTotal" of card x
  733. put "$" & temp2 & return after temp3
  734. put temp2 & return after tempAm
  735. add temp2 to temp4
  736. end repeat
  737. put temp3 into card field "amounts" of card "Year Totals"
  738. put "$" & temp4 into card field "Total" of card "Year Totals"
  739. put temp4 into